{*<p class="error">filetmanager anbindung</p>*}
<div class="divFormFieldLabel">{$content.label|htmlentities}</div>
<div class="divFormField">
	<input type="hidden" name="{$prefix}[{$content.fieldname}]{$suffix}[file]" id="file_{$content.fieldname}_{$obj.obj_id}" value="{$content.image.picture_filename}"/>
	<input type="hidden" name="{$prefix}[{$content.fieldname}]{$suffix}[dir]" id="dir_{$content.fieldname}_{$obj.obj_id}" value="{$content.image.picture_dir}"/>

	<div style="float:left;width:280px;margin-right:40px;">		
		{* Filename --------------------------------------------------------------------------------------------------*}
		<div class="divFormLabelSmall" style="width:110px;">
			Dateiname:
		</div>
		<div id="{$content.fieldname}_{$obj.obj_id}" style="float:left;width:160px;">
			<a href="javascript:void(0);" onclick="{strip}{literal}

					CMS.FileManager.open({
						{/literal}
						root:'media',
						project_id:'{$project_id}',
						multiple:false,
						{literal}
						post_params:{
						{/literal}
							type:'image',
							open_dir:xajax.$('dir_{$content.fieldname}_{$obj.obj_id}').value
						{literal}
						},
						callback:{
							ccdsfun:'FileManagerReturnImage',
							ccdsclass:'ccdsFileManager'
						},
						returnfield:{
						{/literal}
							file : xajax.$('file_{$content.fieldname}_{$obj.obj_id}'),
							dir : xajax.$('dir_{$content.fieldname}_{$obj.obj_id}'),
							label : xajax.$('label_{$content.fieldname}_{$obj.obj_id}'),
							preview : xajax.$('preview_{$content.fieldname}_{$obj.obj_id}'),
							description : xajax.$('description_{$content.fieldname}_{$obj.obj_id}'),
							img : xajax.$('img_{$content.fieldname}_{$obj.obj_id}')
						{literal}
						}
					});
				{/literal}{/strip}">
				<span id="label_{$content.fieldname}_{$obj.obj_id}">
				{if $content.image.picture_filename !=""}
					{$content.image.picture_filename}
				{else}
					Bild auswählen
				{/if}
			</a>
		</div>
		<div class="clear"></div>
		<br />
		{* Image Description -----------------------------------------------------------------------------------------*}
			<div class="divFormLabelSmall" style="width:110px;">Bildbeschreibung:</div>
			<div style="float:left;width:160px;">
				<input type="text" name="{$prefix}[{$content.fieldname}]{$suffix}[description]" id="description_{$content.fieldname}_{$obj.obj_id}" class="FormFieldInput" value="{$content.image.picture_description|htmlentitiesutf8}" style="width:146px;" /><br />
			</div>
			<div class="clear"></div>
			<br />
			<div class="divFormLabelSmall" style="width:110px;">Bild entfernen:</div>
			<div style="float:left;width:160px;">
				<input type="button" value="entfernen" style="width:160px;" onclick="CMS.reset_image('_{$content.fieldname}_{$obj.obj_id}');" /><br />
			</div>
			<div class="clear"></div>
	</div>

	{* Image Preview ------------------------------------------------------------------------------------------------ *}
	
	{if ($content.image.picture_filename !="") }
		{return_resize_img src="`$MEDIA_WEB``$content.image.picture_dir``$content.image.picture_filename`" id="mypic" width="178" height="120" alt="`$filedetails.filename`" stretch="0" style="border:1px solid #ccc;"}<br />
		{assign var="img_src" value=$img_mypic.src}
	{else}
		{assign var="img_src" value="`$CMS_WEB_DIR`img/image-missing.gif"}
	{/if}
	
	<div id="preview_{$content.fieldname}_{$obj.obj_id}" style="float:left;width:180px;text-align:right;">	
			<div id="img_{$content.fieldname}_{$obj.obj_id}" style="width:120px;height:120px;background:url({$img_src}) top left no-repeat;">&nbsp;</div>
			<a href="{$MEDIA_WEB}{$content.image.picture_dir}{$content.image.picture_filename}" target="_blank">&rsaquo; Original</a><br />
	</div>
	<div class="clear"></div>
	{if isset($content.default_path)}
		<div class="divFormLabelSmall" style="width:110px;">(neues) Bild hochladen:</div>
		<div style="float:left;width:380px;">
			<div>
				<input type="input" type="file" name="{$prefix}[{$content.fieldname}]{$suffix}[up]" id="up_{$obj.obj_id}_{$content.fieldname}" size="50" />
			</div>
			<br />
	
			<input type="button" class="submitbtn" value="Bilder hochladen" style="width:160px;" onclick="{xajax_request 
			ccdsfun= "ContentEditorImageUpload"
			ccdsclass = "ccdsContentEditor"
			param_obj_id = "`$obj.obj_id`" 
			param_obj_vers_id = "xajax.$('obj_vers_id_`$obj.obj_id`').value"
			param_filefield = "'up_`$obj.obj_id`_`$content.fieldname`'"
			param_fieldname = "'`$content.fieldname`'"
			mode= "'SWFupload'"
			context_preview = "xajax.$('div`$content.fieldname`preview_`$obj.obj_id`')"
			context_label = "xajax.$('label`$content.fieldname`_`$obj.obj_id`')"
			context_file = "xajax.$('file_`$obj.obj_id`_`$content.fieldname`')"
			context_dir = "xajax.$('dir_`$obj.obj_id`_`$content.fieldname`')"
			SWFfield = "'up_`$obj.obj_id`_`$content.fieldname`'"
		}" />
		</div>
		<div class="clear"></div>
	{/if}
</div>
<br style="clear:both;" />